package sk.tuke.client.components.forms;

import com.smartgwt.client.widgets.form.fields.PasswordItem;

public class DataSourcePasswordField extends com.smartgwt.client.data.fields.DataSourcePasswordField {

	PasswordItem passwordItem;

	public DataSourcePasswordField(String name, boolean required) {
	}

	public DataSourcePasswordField(int width, int height, String name, String title, Integer length, boolean required) {
		passwordItem = new PasswordItem();
		passwordItem.setHeight(height);
		passwordItem.setWidth(width);
		passwordItem.setRequired(required);
		passwordItem.setName(name);
		passwordItem.setTitle(title);
		if (length != null) {
			passwordItem.setLength(length);
		}
		this.setRequired(required);
		this.setName(name);
		this.setEditorType(passwordItem);
	}

	public PasswordItem getPasswordItem() {
		return passwordItem;
	}

	public void setPasswordItem(PasswordItem passwordItem) {
		this.setEditorType(passwordItem);
	}
}
